<!doctype html>
<html lang="zh-CN" th:replace="admin-layout :: layout(~{::title}, ~{::link}, ~{::script}, ~{::body}, 'classify-list')"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <title>分类列表</title>
    <link rel="stylesheet" th:href="@{/common/zTree/css/demo.css}" type="text/css">
    <link rel="stylesheet" th:href="@{/common/zTree/css/zTreeStyle/zTreeStyle.css}" type="text/css">
    <script type="text/javascript" th:src="@{/common/zTree/js/jquery.ztree.core.min.js}"></script>
    <script type="text/javascript" th:src="@{/common/zTree/js/jquery.ztree.excheck.min.js}"></script>
    <script type="text/javascript" th:src="@{/custom/js/classify/admin-classify-tree.js}"></script>
    <script>
        $(".query-btn").click(function(){
            var name = $("#name").val();
            if (name==''){
                return;
            }
            $("#toolbar").submit();
        })
    </script>
</head>
<body>
<div class="fyl-mb10">
    <form id="toolbar" method="post" th:action="@{/admin/classify/table/list}">
        <div class="row">
            <div class="col-sm-4 col-md-4 col-lg-2 fyl-mb10">
                <input type="text" class="form-control fyl-clear" name="name" id="name"
                       placeholder="分类名称" th:value="${query.name}">
            </div>
            <div class="col-sm-4 col-md-4 col-lg-2 fyl-mb10">
                <select class="form-control fyl-clear" name="dataType">
                    <option value="-1">分类类型</option>
                    <option value="0">试题</option>
                </select>
            </div>
            <div class="col-sm-4 col-md-4 col-lg-2 fyl-mb10">
                <button type="button" class="btn btn-primary query-btn">查询</button>
                <a href="javascript:void(0)" class="btn btn-warning" id="clearSearchBtn">清空</a>
            </div>
        </div>
    </form>
</div>
<div class="fyl-mb20">
    <a th:href="@{/admin/classify/save}" class="btn btn-primary">添加</a>
    <button type="button" class="btn btn-primary" id="updateBtn" disabled>修改</button>
    <button type="button" class="btn btn-danger" id="removeBtn" disabled>删除</button>
</div>
<ul id="treeDemo" class="ztree"></ul>
</body>
</html>